<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组去重</title>
    <script src="js/jquery-1.7.2.js"></script>
</head>
<body>
    <div id="test"></div>
    <script>
        Array.prototype.unique1 = function() {
            var arr = [];
            for (var i = 0; i < this.length; i++) {
                var item = this[i];
                if (arr.indexOf(item) === -1) {
                    arr.push(item);
                }
            }
            return arr;
        };
                [1,2,3,'4',3,4,3,1,'34',2].unique1();
    </script>
</body>
</html>